<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>三元运算符比较最大值</title>
</head>

<body>
    <script>
        var a = prompt('请输入a的值');
        var b = prompt('请输入b的值');
        var c = prompt('请输入c的值');
        if (parseFloat(a) > parseFloat(b)) {
            if (parseFloat(a) > parseFloat(c)) {
                alert(a);
            } else {
                alert(c);
            }
        } else {
            if (parseFloat(b) > parseFloat(c)) {
                alert(b);
            } else {
                alert(c);
            }
        }
    </script>
</body>

</html>